The present disclosure relates to file systems on computing systems, and more specifically to ensuring file system consistency while file backup operations are performed on a mounted storage volume.
File systems generally maintain data and metadata associated with a given file separately. A file system generally writes files as blocks of data at multiple locations on a storage device (e.g., for hard disk drives, a particular cylinder, track, and sector). Meanwhile, file systems maintain metadata information such as a directory structure, ownership, permissions, addresses for each file, and so on.
Operating systems on a computer sometimes encounter unrecoverable errors or power loss during regular operations (e.g., system backup operations), which may interrupt file read/write/modify operations. When such errors occur, an operating system may force a hard reboot, which may interrupt file operations and generate inconsistencies in the file system (e.g., deleted nodes marked in use, metadata pointing to unwritten data, space leaks, and so on). In some cases, inconsistencies may appear between metadata and file data for files that a user accesses only occasionally, which may result in some data loss. However, when inconsistencies appear in critical files, such as file system metadata tables or operating system libraries, the operating system may be unable to be booted or restored to normal operation successfully.
Typically, backup systems are configured to freeze a file system and access (or attempt to access) each file maintained in a file system to back up the files maintained in the file system to another destination (e.g., a network attached storage, backup media connected to a local computer, and so on). When backup operations encounter inconsistencies in file metadata, backup operations may fail, or the backup may include invalid data. In either case, backup operations may not generate a complete and accurate back up copy of the file system.
To prevent failures in creating a backup copy of the files maintained in the file system, a user can check the file system using a file system consistency check tool (e.g., the fsck utility in *nix operating systems or the chkdsk utility in Windows operating systems). Generally, a file system consistency check is performed on an unmounted file system to produce dependable results, as different file system information may exist in machine memory and on a storage device associated with a file system. If file consistency checks are performed on a mounted file system, disk corruption may occur. Performing a file system consistency check at boot time or when the file system is otherwise unmounted generally allows an operating system to attempt to repair file system errors (e.g., inconsistencies between files and associated metadata) but may keep a system offline for an extended period of time. Because file system errors may not always be present in critical files or files that are accessed regularly during normal system operations, performing a file system consistency check at boot time may extend system downtime without fixing critical errors. Additionally, due to service level guarantees or other availability requirements, a computing system may not be able to unmount a file system to perform a file system consistency check without violating the service level guarantees or availability requirements